import request from '@/utils/request.js';
const BASE_URL = process.env.VUE_APP_ROOT_URL === './' ? '' : 'http://10.10.40.151'

//获取授权信息
export function getLicenseInfoDto(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/license-info/licenseInfoResult`,
    ...{
      ...{
        ...config,
        hideAppToken: true
      },
      hideAppToken: true
    }
  });
}
//授权历史记录
export function getLicenseList(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/license-info-detail/all`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//获取离线激活信息
export function getRemoteActiveInfo(params = {}, config = {}) {
  return request({
    method: 'get',
    params,
    url: BASE_URL + `/api/license/getRemoteActiveInfo`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//获取离线解绑信息
export function getRemoteUnbindInfo(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/getRemoteUnbindInfo`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//获取是否激活
export function getActivitedStatus(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/getActiveType`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//解绑
export function unbindAuth(params = {}, config = {}) {
  return request({
    method: 'get',
    params,
    url: BASE_URL + `/api/license/unbind`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//在线激活
export function activeAuth(data = {}, params = {}, config = {}) {
  return request({
    method: 'post',
    data,
    params,
    url: BASE_URL + `/api/license/getActiveCode`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//离线证书激活
export function offlineActive(data = {}, params = {}, config = {}) {
  return request({
    method: 'post',
    data,
    params,
    url: BASE_URL + `/api/license/offlineActive`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//获取是否在线
export function getLicenseIsOnline(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/license-server-available`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}
//确认解绑
export function confirmUnbind(config = {}) {
  return request({
    method: 'get',
    url: BASE_URL + `/api/license/confirmUnbind`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}

//分配席位
export function distributionSeatUids(params = {}, config = {}) {
  return request({
    method: 'get',
    params,
    url: BASE_URL + `/api/license/distributionSeatUids`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}

//解绑席位
export function unbindSeatUids(params = {}, config = {}) {
  return request({
    method: 'get',
    params,
    url: BASE_URL + `/api/license/unbindSeatUids`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}


//激活码类型
export function getLicenseType(params = {}, config = {}) {
  return request({
    method: 'get',
    params,
    url: BASE_URL + `/api/license/getLicenseType`,
    ...{
      ...config,
      hideAppToken: true
    }
  });
}